import { PORT2 } from '@/api/config/servicePort';
import http from '@/api';

/**
 * @name 登录模块
 */
// 用户登录
export const loginApi = params => {
  return http.post(PORT2 + `/auth/login`, params, { loading: false });
};

// 测试接口目前用于检测token是否过期
export const verifyToken = () => http.post(PORT2 + `/auth/checkToken`);

// 查询版本
export const versionSearch = () => http.get(PORT2 + `/auth/search/NMES-PC`);

// 获取用户权限
export const userFindPermission = (params: { username: string }) => {
  return http.get(PORT2 + `/user/findPermission`, params, { loading: false });
};

// 用户退出登录
export const logoutApi = () => {
  return http.post(PORT2 + `/auth/logout`);
};
